<h1 class="page-title">新增车辆</h1>
<div class="well" ng-controller="CarNewController as vm">
  <form class="form-horizontal" ng-submit="vm.processForm()">
    <fieldset>
        <div class="span6">
      <div class="control-group" ng-show="vm.userRole=='admin'">
        <label class="control-label">*选择个人会员</label>
        <div class="controls">
            <select class="input-large" ng-model="vm.car.carrierId" ng-options="o.id as o.selectObj for o in carriers">
              <option value="">-- 请选择 --</option>
            </select>
            <p class="help-block"></p>
          </div>
      </div>
      <div class="control-group">
        <!-- Text input-->
        <label class="control-label" for="input01">*车牌号</label>
        <div class="controls">
          <input type="text" placeholder="" class="input-large" ng-model="vm.car.vehicleNumber">
          <p class="help-block"></p>
        </div>
      </div>
      <div class="control-group">
        <!-- Text input-->
        <label class="control-label" for="input01">挂车号</label>
        <div class="controls">
          <input type="text" placeholder="" class="input-large" ng-model="vm.car.trailerNumber">
          <p class="help-block"></p>
        </div>
      </div>
      
      <div class="control-group">
        <!-- Text input-->
        <label class="control-label" for="input01">*车辆识别代号</label>
        <div class="controls">
          <input type="text" placeholder="" class="input-large" ng-model="vm.car.vehicleLicenseNumber">
          <p class="help-block"></p>
        </div>
      </div>
      
      <div class="control-group">
        <!-- Text input-->
        <label class="control-label" for="input01">*车辆型号</label>
        <div class="controls">
          <input type="text" placeholder="" class="input-large" ng-model="vm.car.model">
          <p class="help-block"></p>
        </div>
      </div>
      
      <div class="control-group">
        <!-- Text input-->
        <label class="control-label" for="input01">车辆产权证号</label>
        <div class="controls">
          <input type="text" placeholder="" class="input-large" ng-model="vm.car.vehicleOwnershipCertificateNumber">
          <p class="help-block"></p>
        </div>
      </div>
      </div>
      <div class="span6">
      <div class="control-group">
        <!-- Text input-->
        <label class="control-label" for="input01">*车辆载重</label>
        <div class="controls">
          <input type="text" placeholder="" class="input-large" ng-model="vm.car.capacity"> 吨
          <p class="help-block"></p>
        </div>
      </div>
      <div class="control-group">
        <!-- Text input-->
        <label class="control-label" for="input01">挂靠企业名称</label>
        <div class="controls">
          <input type="text" placeholder="" class="input-large" ng-model="vm.car.employer">
          <p class="help-block"></p>
        </div>
      </div>
      <div class="control-group">
        <!-- Text input-->
        <label class="control-label" for="input01">备注1</label>
        <div class="controls">
          <input type="text" placeholder="" class="input-large" ng-model="vm.car.reserved1">
          <p class="help-block"></p>
        </div>
      </div>
      <div class="control-group">
        <!-- Text input-->
        <label class="control-label" for="input01">备注2</label>
        <div class="controls">
          <input type="text" placeholder="" class="input-large" ng-model="vm.car.reserved2">
          <p class="help-block"></p>
        </div>
      </div>
      
      
      <div class="control-group">
        <!-- Text input-->
        <label class="control-label" for="input01">备注3</label>
        <div class="controls">
          <input type="text" placeholder="" class="input-large" ng-model="vm.car.reserved3">
          <p class="help-block"></p>
        </div>
      </div>
      
      <div class="control-group">
        <label class="control-label">*行驶证</label>
        <div class="controls">
            <input type="text" id="xingshi" placeholder="" class="input-large" style="display: none"/>
            <image id="xingshiImg" style="display: none;" width="30" height="40"></image>
            <a style="cursor: hand" onclick="openUpload('xingshi')">上传文件</a>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label">保险单合同</label>
        <div class="controls">
            <input type="text" id="baoxian" placeholder="" class="input-large" style="display: none"/>
            <image id="baoxianImg" style="display: none;" width="30" height="40"></image>
            <a style="cursor: hand" onclick="openUpload('baoxian')">上传文件</a>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label">挂靠企业合同</label>
        <div class="controls">
            <input type="text" id="gua" placeholder="" class="input-large" style="display: none"/>
            <image id="guaImg" style="display: none;" width="30" height="40"></image>
            <a style="cursor: hand" onclick="openUpload('gua')">上传文件</a>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label">*运输许可证</label>
        <div class="controls">
            <input type="text" id="yunshu" placeholder="" class="input-large" style="display: none"/>
            <image id="yunshuImg" style="display: none;" width="30" height="40"></image>
            <a style="cursor: hand" onclick="openUpload('yunshu')">上传文件</a>
        </div>
      </div>
      </div>
    </fieldset>
    <div class="control-group">
      <label class="control-label"></label>
      <!-- Button -->
      <div class="controls">
        <button class="btn btn-primary" ng-disabled="uploadingLic1 || uploadingLic2 || uploadingLic3" >新增</button>
      </div>
    </div>
  </form>
    <script>
        function openUpload(inputid){
            var url = "../views/upload.html?id="+ inputid;
            var iWidth=400; //弹出窗口的宽度;
            var iHeight=300; //弹出窗口的高度;
            var iTop = (window.screen.availHeight-30-iHeight)/2; //获得窗口的垂直位置;
            var iLeft = (window.screen.availWidth-10-iWidth)/2; //获得窗口的水平位置;
            window.open(url,'uploadwindow','height='+iHeight+',width='+iWidth+',top='+iTop+',left='+ iLeft +',toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');
        }
    </script>
</div>